package com.breakfast.fun.data.entity.home;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.io.Serializable;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * 早餐商品
 * Created by Administrator on 2016/8/18.
 */
public class Product implements Serializable {

    /**
     * id : 324
     * name : 豆浆粉套餐
     * image : http://static.52letsgo.cn/product_image/11/6/d99289e8-8_1835034399.jpg
     * bigImage : http://static.52letsgo.cn/product_image/2/10/5d08d6eb-c_-801972071.jpg
     * sellcount : 90
     * praise : 0
     * count : 99999
     * dateCount : 66
     * price : 8.9
     * categoryId : 21
     * categoryName : 周一
     * des : 豆浆粉+荷包蛋+小菜
     * shopId : 32
     * shopName : 淘麦多
     * closetime : 22:00:00
     * type : 0
     * showType : page
     * isExprice : 1
     * horImage: "/product_image/5/5/b4e58f4d-2_-1168075697.jpg"
     */

    private int id;
    private String name;
    private String image;
    private String bigImage;
    private String horImage;
    private int sellcount;
    private int praise;
    private int count;
    private int dateCount;
    private double price;
    private int categoryId;
    private String categoryName;
    private String des;
    private int shopId;
    private String shopName;
    private String closetime;
    private int type;
    private String showType;
    private int isExprice;
    private String productClassId;

    private String className;
    private String sdes;


    public static Product objectFromData(String str) {

        return new Gson().fromJson(str, Product.class);
    }

    public static List<Product> arrayProductFromData(String str) {

        Type listType = new TypeToken<ArrayList<Product>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getBigImage() {
        return bigImage;
    }

    public void setBigImage(String bigImage) {
        this.bigImage = bigImage;
    }

    public int getSellcount() {
        return sellcount;
    }

    public void setSellcount(int sellcount) {
        this.sellcount = sellcount;
    }

    public int getPraise() {
        return praise;
    }

    public void setPraise(int praise) {
        this.praise = praise;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public int getDateCount() {
        return dateCount;
    }

    public void setDateCount(int dateCount) {
        this.dateCount = dateCount;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(int categoryId) {
        this.categoryId = categoryId;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }

    public int getShopId() {
        return shopId;
    }

    public void setShopId(int shopId) {
        this.shopId = shopId;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public String getClosetime() {
        return closetime;
    }

    public void setClosetime(String closetime) {
        this.closetime = closetime;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getShowType() {
        return showType;
    }

    public void setShowType(String showType) {
        this.showType = showType;
    }

    public int getIsExprice() {
        return isExprice;
    }

    public void setIsExprice(int isExprice) {
        this.isExprice = isExprice;
    }

    public String getProductClassId() {
        return productClassId;
    }

    public void setProductClassId(String productClassId) {
        this.productClassId = productClassId;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getSdes() {
        return sdes;
    }

    public void setSdes(String sdes) {
        this.sdes = sdes;
    }

    public String getHorImage() {
        return horImage;
    }

    public void setHorImage(String horImage) {
        this.horImage = horImage;
    }

    @Override
    public String toString() {
        return "Product{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", image='" + image + '\'' +
                ", bigImage='" + bigImage + '\'' +
                ", sellcount=" + sellcount +
                ", praise=" + praise +
                ", count=" + count +
                ", dateCount=" + dateCount +
                ", price=" + price +
                ", categoryId=" + categoryId +
                ", categoryName='" + categoryName + '\'' +
                ", des='" + des + '\'' +
                ", shopId=" + shopId +
                ", shopName='" + shopName + '\'' +
                ", closetime='" + closetime + '\'' +
                ", type=" + type +
                ", showType='" + showType + '\'' +
                ", isExprice=" + isExprice +
                ", productClassId='" + productClassId + '\'' +
                ", className='" + className + '\'' +
                ", sdes='" + sdes + '\'' +
                '}';
    }
}
